package com.mi.minal.mybatis.entity;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.mi.rule.db.entity.MiEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 关联表（角色-资源） 实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_link_role_resource")
public class SysLinkRoleResource extends Model<SysLinkRoleResource> implements MiEntity {

    public static final String TABLE_NAME = "sys_link_role_resource";

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private String resourceUrl;

    @TableId("role_id")
    private String roleId;

    @TableField("resource_id")
    private String resourceId;


    public static final String ROLE_ID = "role_id";
    public static final String ROLE_ID_TF = "roleId";
    public static final String RESOURCE_ID = "resource_id";
    public static final String RESOURCE_ID_TF = "resourceId";

    /**
     * 返回当前对象的JSON字符串
     */
    public String jsonStr() {
        return JSON.toJSONString(this);
    }
}
